<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionView::Template::Types::Type</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionView::Template::Types::Type 
            
                <span class="parent">&lt; 
                    
                    <a href="../../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../../files/actionpack/lib/action_view/template/types_rb.html">actionpack/lib/action_view/template/types.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>#</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Type.html#method-i-3D-3D">==</a>,
              </li>
            
              
              <li>
                <a href="Type.html#method-c-5B-5D">[]</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Type.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Type.html#method-i-ref">ref</a>,
              </li>
            
              
              <li>
                <a href="Type.html#method-c-register">register</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>symbol</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-5B-5D">
            
              <b>[]</b>(type)
            
            <a href="Type.html#method-c-5B-5D" name="method-c-5B-5D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-5B-5D_source')" id="l_method-c-5B-5D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/15bd0f60db821ee435d42431317921f5487f0d4c/actionpack/lib/action_view/template/types.rb#L17" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-5B-5D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/template/types.rb, line 17</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">type</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">type</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-keyword">self</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">types</span>.<span class="ruby-identifier">member?</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>)
    <span class="ruby-identifier">new</span>(<span class="ruby-identifier">type</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(symbol)
            
            <a href="Type.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/15bd0f60db821ee435d42431317921f5487f0d4c/actionpack/lib/action_view/template/types.rb#L27" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/template/types.rb, line 27</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">symbol</span>)
  <span class="ruby-ivar">@symbol</span> = <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_sym</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-register">
            
              <b>register</b>(*t)
            
            <a href="Type.html#method-c-register" name="method-c-register" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-register_source')" id="l_method-c-register_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/15bd0f60db821ee435d42431317921f5487f0d4c/actionpack/lib/action_view/template/types.rb#L11" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-register_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/template/types.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">register</span>(*<span class="ruby-identifier">t</span>)
  <span class="ruby-identifier">types</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">t</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span> })
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-3D-3D">
            
              <b>==</b>(type)
            
            <a href="Type.html#method-i-3D-3D" name="method-i-3D-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-3D-3D_source')" id="l_method-i-3D-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/15bd0f60db821ee435d42431317921f5487f0d4c/actionpack/lib/action_view/template/types.rb#L38" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-3D-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/template/types.rb, line 38</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">==</span>(<span class="ruby-keyword ruby-title">type</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">blank?</span>
  <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_sym</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-ref">
            
              <b>ref</b>()
            
            <a href="Type.html#method-i-ref" name="method-i-ref" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-ref_source')" id="l_method-i-ref_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/15bd0f60db821ee435d42431317921f5487f0d4c/actionpack/lib/action_view/template/types.rb#L34" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-ref_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_view/template/types.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">ref</span>
  <span class="ruby-identifier">to_sym</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    